﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DOMINIO;
using BL;

namespace Presentacion
{
    public partial class frmEmpleado : System.Web.UI.Page
    {
        EmpleadoBL empBL;

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            empBL = new EmpleadoBL();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.IsInRole("rrhh"))
            {
                Response.Redirect("Default.aspx");
            }

            object obj = Request.QueryString["acc"];

            if (obj != null)//!=
            {
                if (obj.ToString() == "editar")//nuevo
                {
                    FormView1.ChangeMode(FormViewMode.Edit);
                }

            }
        }

        protected void FormView1_ItemUpdated(object sender, FormViewUpdatedEventArgs e)
        {
            Response.Redirect("frmGestionarEmpleado.aspx");
        }

        protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
        {
            Response.Redirect("frmGestionarEmpleado.aspx");
        }
    }
}